package cn.fzhui;

/**
 * 手机卡
 * 卡类型、卡号、用户名、密码、账户余额、通话时长(分钟)、上网流量
 */
public class Card {

    // 类型
    private CardType type;

    // 卡号
    private String number;

    // 用户名
    private String username;

    // 余额
    private double balance;

    // 通话时长
    private double lengthOfCall;

    // 上网流量
    private double traffic;

    public CardType getType() {
        return type;
    }

    public Card() {
    }

    /**
     * 有参构造
     *
     * @param type
     * @param number
     * @param username
     * @param balance
     * @param lengthOfCall
     * @param traffic
     */
    public Card(CardType type, String number, String username, double balance, double lengthOfCall, double traffic) {
        this.type = type;
        this.number = number;
        this.username = username;
        this.balance = balance;
        this.lengthOfCall = lengthOfCall;
        this.traffic = traffic;
    }


    public void setType(CardType type) {
        this.type = type;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getLengthOfCall() {
        return lengthOfCall;
    }

    public void setLengthOfCall(double lengthOfCall) {
        this.lengthOfCall = lengthOfCall;
    }

    public double getTraffic() {
        return traffic;
    }

    public void setTraffic(double traffic) {
        this.traffic = traffic;
    }

    /**
     * 显示（卡号 + 用户名 + 当前余额）
     */
    public void display() {
        System.out.println("卡号：" + this.number);
        System.out.println("用户名：" + this.username);
        System.out.println("当前余额：" + this.balance);
    }
}
